package models

import (
	_ "github.com/astaxie/beego/orm"
	"github.com/beego/beego/v2/client/orm"
	_ "github.com/beego/beego/v2/client/orm"
	_ "github.com/go-sql-driver/mysql"
	_ "time"
)

type GoJob struct {
	Id int `orm:"pk;auto;column(class_id)"`
	Name string `orm:"size(100);column(class_name)"`
	UserId  int `orm:"size(10);column(user_id)"`
}

func (u *GoJob) TableName()string  {
	return "go_job"
}
func AddClass (u GoJob) bool{
	newOrm := orm.NewOrm()
	_, err := newOrm.Raw("insert into go_job values (?,?,?)", u.Id, u.Name, u.UserId).Exec()
	if err!=nil{
		panic(err)
	}
	return true
}